var tplLC = 
	'<div class="materialItem">'+
		'<div class="item-img"><img src="resources/images/cli_icon.png" width="45" height="45"></div>'+
		'<div style="float:left; width:83%;">'+
		'<div class="list-codigo">'+
			'<span>{Codigo}&nbsp;&nbsp;-&nbsp;&nbsp;{Ruc}</span>'+
			'<br />'+
			'<span>{Descripcion}</span>'+
		'</div>'+
		'</div>'+
	'</div>';

listaClienteView2 = Ext.extend(Ext.Panel, 
{
	fullscreen: true,
	layout: 'card',
		
	initComponent: function() 
	{
		this.listaCli = new Ext.List(
		{
			id: 'listaCli',
			grouped: false,
			itemTpl: tplLC,
			loadingText: false,
			store: listaCliStore,
			grouped: true,
			//onItemDisclosure: function(record){
				//var codigo = record.data.CodMaterial;
				//console.log(codigo);
			//},
			//listeners: {
				//itemtap: function (listaMAT, index, element, event) {
					//var record = listaMAT.getRecord(element);
					//console.log(record.data.CodMaterial); 
				//}
			//}
	    });
		
		this.crearDocPanel = new Ext.Panel(
        {
			layout: 'fit',
			dockedItems: [
            {
				xtype: 'toolbar',
				title: 'Lista de Clientes',
            	dock: 'top',
            	items: [
            	{
            		ui: 'back',
					text: 'Volver',
					iconCls: 'reply',
					iconMask: true,
					scope: this,
					handler: function()
					{
						this.ownerCt.setActiveItem(this.prevCard,
						{
							type: 'slide',
							reverse: true,
							scope: this
						});
        			}
				},
				{
					xtype: 'spacer'
				},
				{
					xtype: 'button',
					ui: 'confirm',
					text: 'Seleccionar',
					iconCls: 'add',
					iconMask: true,
					scope: this,
					handler: function()
					{
						Ext.Msg.alert('', 'Cliente Seleccionado', function(res)
						{
							window.open("reclamo.html","_self");
						}, this);        			
					}
				}]
			}],
			items: this.listaCli
		});		
        
        this.items = this.crearDocPanel;
        listaClienteView2.superclass.initComponent.call(this);
	}
});

Ext.reg('listaClienteView2', listaClienteView2);